package com.pazl.check.api.controller;

import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.pazl.check.api.req.dto.Req222Dto;
import com.pazl.check.api.req.dto.Req225Dto;
import com.pazl.check.api.req.dto.Req25Dto;
import com.pazl.check.dto.MessageDto;
import com.pazl.check.utils.MessageUtil;

/**
 * 
 * 接口请求入参校验控制器
 * 可用于查看代码逻辑之前的简单check
 * 
 * version 20200511
 * 
 * @author chenyn
 *
 * 2020年5月11日
 */
@RestController
@RequestMapping("api")
@Validated
public class ApiReqController {

	/**
	 * req 2.5 check
	 * @param dto
	 * @return
	 */
	@PostMapping(value = "req25")
	public MessageDto req(@Validated @RequestBody Req25Dto dto ){
		return MessageUtil.ok("check sucess.");
	}
	
	/**
	 * req 2.22 check
	 * @param dto
	 * @return
	 */
	@PostMapping(value = "req222")
	public MessageDto req(@Validated @RequestBody Req222Dto dto ){
		return MessageUtil.ok("check sucess.");
	}
	
	/**
	 * req 2.25 check
	 * @param dto
	 * @return
	 */
	@PostMapping(value = "req225")
	public MessageDto req(@Validated @RequestBody Req225Dto dto ){
		return MessageUtil.ok("check sucess.");
	}
}
